function extend (instance, valueObj, context) {
    if (typeof instance === 'function' && typeof valueObj === 'object') {
        for (const key in valueObj) {
            if (Object.hasOwnProperty.call(valueObj, key)) {
                let element = valueObj[key]
                if (typeof element === 'function') {
                    // 硬绑定：使函数的 this 指向始终指向 Axios创建的context对象
                    element = element.bind(context)
                }
                instance[key] = element
            }
        }
    }
}

module.exports = extend